* {
    padding: 0;
    margin: 0;
    list-style: none;
}

h1::after {
    content: attr(data-title);
}

.mode-wrap {
    margin: 50px;
}
.rect {
    width: 50px;
    height: 50px;
    background-color: red;
    transform: rotate(45deg);
}
.rect::before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background-color: red;
    border-radius: 50%;
    transform: translate(0px, -22px);
}

.rect::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background-color: red;
    border-radius: 50%;
    transform: translate(-22px, -50px);
}
/* 清除浮动 */
.mode-wrap::after {
    content: '';
    display: block;
    clear:left;
}

.mode-wrap li {
    position: relative;
    margin: 50px;
    float: left;
    animation-name: grow;
    animation-timing-function: linear;
    animation-delay: 0;
    animation-duration: .7s;
    animation-iteration-count: infinite;
}

.mode-wrap li::after {
    width: 300px;
    content: attr(data-title);
    display: block;
    position: absolute;
    left: 0;
    top: -70px;
}


@keyframes grow {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1.5);
    }
}

/* animation-direction四种模式： */
.mode-wrap li:nth-last-of-type(1) {
    animation-direction: normal;
}

.mode-wrap li:nth-last-of-type(2) {
    animation-direction:reverse;
}

.mode-wrap li:nth-last-of-type(3) {
    animation-direction:alternate;
}

.mode-wrap li:nth-last-of-type(4) {
    animation-direction:alternate-reverse;
}



/* 弹跳小球的例子： */
.ball-wrap {
    width: 100%;
    height: 500px;
    background-color: aliceblue;
}

.ball-wrap .ball{
    transform: translateY(300px);
    margin: 50px;
    width: 40px;
    height: 40px;
    background-color: rgb(94, 25, 11);
    border-radius: 50%;
/* 动画 */
    animation-name: ball;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-direction: alternate-reverse;
    animation-timing-function:ease;
}

.ball-wrap .ball-shallow {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, .3);
    transform: translate(40px, 220px);
    border-radius: 50%;
    z-index: -1;
    filter: blur(5px);
    transform-origin: center;
    animation-name: shadow;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-direction: alternate-reverse;
}


@keyframes ball {
    to {
        transform: translateY(0px);
    }
}

@keyframes shadow {
    to {
        width: 100px;
        height: 100px;
        filter: (35px);
        background-color: rgba(0, 0, 0, .03);
    }
}





/* 步径动画 */
.step-wrap {
    margin: 50px 0;
    padding-top: 10px;
    width: 100%;
    height: 500px;
    background-color: rgb(37, 37, 37);
}

.step-wrap .grid{
    width: 400px;
    height: 200px;
    background-color: aliceblue;
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(4, 1fr);
    justify-items: center;
    align-items: center;
    row-gap: 10px;
    column-gap: 10px;
}

.step-wrap .grid li {
    color: white;
    position: relative;
    width: 100%;
    display: flex;
    background-clip: content-box;
    background-color: rgb(246, 135, 0);
    height: 100%;
    align-items: center;
    justify-content: center;
}

.step-wrap .grid li:nth-child(1)::after {
    content: "START";
    display: block;
    width: 100%;
    height: 100%;
    background-color: blueviolet;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9;
    /* 步路动画 */
    animation-timing-function: steps(4, start);
    animation-name: step1;
    animation-iteration-count: infinite;
    animation-duration: 4s;
    /* 决定最终的状态  最终动画结束时候的位置 */
    animation-fill-mode:forwards;
}

.step-wrap .grid li:nth-child(5)::after {
    content: "END";
    width: 100%;
    height: 100%;
    background-color: rgb(83, 193, 24);
    position: absolute;
    left: 0;
    top: 0;
    /* 步路动画 */
    animation-name: step1;
    animation-duration: 4s;
    z-index: 9;
    animation-timing-function: steps(4, end);
    animation-iteration-count: infinite;
    /* animation-timing-function: step-end; */
}

@keyframes step1 {
    to {
        transform: translateX(330px);
    }
}

.step-wrap:hover .grid li:nth-child(1)::after{
    animation-play-state: paused;
}

.step-wrap:hover .grid li:nth-child(5)::after{
    animation-play-state: paused;
}

